home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / LockedHeap.cc,v < prev    next >
Text File  |  1989-03-28  |  1KB  |  93 lines

  1. head     3.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:3.2; strict;
  6. comment  @@;
  7.  
  8.  
  9. 3.2
  10. date     89.02.20.15.35.47;  author grunwald;  state Exp;
  11. branches ;
  12. next     3.1;
  13.  
  14. 3.1
  15. date     88.12.20.13.48.56;  author grunwald;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 3.2
  25. log
  26. @Start using Gnu library heaps for schedulers
  27. @
  28. text
  29. @// This may look like C code, but it is really -*- C++ -*-
  30. // 
  31. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  32. //
  33. // written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
  34. //
  35. #include "LockedHeap.h"
  36. #include "stream.h"
  37.  
  38. void
  39. LockedHeap::add(AwesimeHeapItem &t)
  40. {
  41.     heapLock.reserve();
  42.     AwesimeHeap::add(t);
  43.     heapLock.release();
  44. }
  45.  
  46. bool
  47. LockedHeap::remove(AwesimeHeapItem &t)
  48. {
  49.     heapLock.reserve();
  50.     bool ok = AwesimeHeap::remove(t);
  51.     heapLock.release();
  52.     return(ok);
  53. }
  54.  
  55. bool
  56. LockedHeap::doStart(AwesimeHeapIndex &)
  57. {
  58.     assert(0);
  59.     return(0);
  60. }
  61.  
  62. void
  63. LockedHeap::doDone()
  64. {
  65.     assert(0);
  66. }
  67.  
  68. unsigned int
  69. LockedHeap::size()
  70. {
  71.     heapLock.reserve();
  72.     unsigned int s = AwesimeHeap::size();
  73.     heapLock.release();
  74.     return(s);
  75. }
  76.  
  77.  
  78. void LockedHeap::classPrintOn(ostream& s)
  79. {
  80.     heapLock.reserve();
  81.     s << * ((AwesimeHeap *) this) ;
  82.     heapLock.release();
  83. }
  84. @
  85.  
  86.  
  87. 3.1
  88. log
  89. @Steay version
  90. @
  91. text
  92. @@
  93.